package com.xgq.drink.controller;

import com.xgq.drink.entity.R;
import com.xgq.drink.entity.Role;
import com.xgq.drink.mapper.RoleMapper;
import com.xgq.drink.utils.RUtils;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 角色表 前端控制器
 * </p>
 *
 * @author xgq
 * @since 2025-04-30
 */
@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleMapper roleMapper;

    @GetMapping("/list")
    @Operation(summary = "获取所有角色列表")
    public R getAllRoles() {
        return RUtils.success("查询成功", roleMapper.selectList(null));
    }
}
